<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>面向对象</title>
</head>
<body>
    
</body>
<script>
    class User{
        constructor (name,pass){
            this.name=name;
            this.pass=pass;
        }
    }
    let user1= new User('李欢庭','12345');
    alert(user1.name+','+user1.pass);

    class VIP extends User{
        constructor(name,pass,level){
            super(name,pass);//需要传入值
            this.level=level;
        }
    }
    let user2= new VIP('李欢庭','12345',6);
    alert(user2.name+','+user2.pass+','+user2.level);
</script>
</html>